java.lang.Object
ddejonge.bandana.calculators.Team
- All Implemented Interfaces:
java.io.Serializable
public class Team
extends java.lang.Object
implements java.io.Serializable
Immutable class that represents a group of agents or powers to which we want to assign a single score.
Essentially nothing more than a list of agent names or power names, together with a team name.
Note that this has nothing to do with the concept of a 'coalition' in a game. That is, if two players are in the same Team it does not mean that they will be cooperating with each other. In fact, they will not even be aware that they have been put together in a Team. It only means that a ScoreCalculator will assign a single score to the entire Team rather than to its individual members.
Essentially nothing more than a list of agent names or power names, together with a team name.
Note that this has nothing to do with the concept of a 'coalition' in a game. That is, if two players are in the same Team it does not mean that they will be cooperating with each other. In fact, they will not even be aware that they have been put together in a Team. It only means that a ScoreCalculator will assign a single score to the entire Team rather than to its individual members.
- Author:
- Dave de Jonge, Western Sydney University
- See Also:
- Serialized Form
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description static java.util.List<Team>
generateTeams(java.lang.String... memberNames)
Returns a list of Teams in which each team contains exactly one member.static java.util.List<Team>
generateTeams(java.util.List<java.lang.String> memberNames)
Returns a list of Teams in which each team contains exactly one member.java.util.List<java.lang.String>
getMemberNames()
Returns an unmodifiable copy of the list of member names.java.lang.String
getTeamName()
java.lang.String
toString()
-
Constructor Details
-
Team
public Team(java.lang.String teamName, java.lang.String... members)- Parameters:
teamName
- The name of this team.members
- The names of the members of this team. These can be either player names or power names (but not a combination of both).
-
Team
public Team(java.lang.String teamName, java.util.Collection<java.lang.String> members)- Parameters:
teamName
- The name of this team.members
- The names of the members of this team. These can be either player names or power names (but not a combination of both).
-
-
Method Details
-
getTeamName
public java.lang.String getTeamName() -
getMemberNames
public java.util.List<java.lang.String> getMemberNames()Returns an unmodifiable copy of the list of member names. This list may contain either player names or power names.- Returns:
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-
generateTeams
Returns a list of Teams in which each team contains exactly one member.- Parameters:
memberNames
- Can be either player names or power names.- Returns:
-
generateTeams
Returns a list of Teams in which each team contains exactly one member.- Parameters:
memberNames
- Can be either player names or power names.- Returns:
-